﻿using System.Runtime.InteropServices.ComTypes;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using AssetManageSystem.Model.AssetManage;
using AssetManageSystem.Model.OrgManage;
using AssetManageSystem.Model.Enum;


namespace AssetManageSystem.ViewModel.AssetManage.AssetInfoVMs
{
    public partial class AssetInfoSearcher : BaseSearcher
    {
        [Display(Name = "资产名称")]
        public String AsName { get; set; }

        public List<ComboSelectListItem> AllTypes { get; set; }
        [Display(Name = "资产类型")]
        public Guid? TypeId { get; set; }
        
        [Display(Name = "购入时间")]
        public DateRange BuyTime { get; set; }

        public List<ComboSelectListItem> AllUsePeoples { get; set; }
        [Display(Name = "使用人")]
        public Guid? UsePeopleId { get; set; }

        public List<ComboSelectListItem> AllUseDeps { get; set; }
        [Display(Name = "使用部门")]
        public Guid? UseDepId { get; set; }

        [Display(Name = "资产状态")]
        public AsStatusEnum? Status { get; set; }

        public Guid? Id { get; set; }

        public List<string> Ids { get; set; }

        public List<string> AsStatus { get; set; }



        protected override void InitVM()
        {
            AllTypes = DC.Set<AssetType>().GetSelectListItems(Wtm, y => y.TypeName);
            AllUsePeoples = DC.Set<User>().GetSelectListItems(Wtm, y => y.UserName);
            AllUseDeps = DC.Set<Department>().GetSelectListItems(Wtm, y => y.DepName);
        }

    }
}
